Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^6: [OT: JavaScript] JS remainder operation ('%')

by syphilis (Archbishop)
on Jan 18, 2024 at 14:23 UTC ( [id://11157081]=note: print w/replies, xml ) Need Help??


in reply to Re^5: [OT: JavaScript] JS remainder operation ('%')
in thread [OT: JavaScript] JS remainder operation ('%')

Wouldn't it be better to s/perl/print/g here?

That would be better. (Some might even argue that "perl's interpolation" would be the more strictly accurate replacement - since all print() does is to output what perl has interpolated ... but that sort of thinking is way too moot for me to understand ;-)

IMHO your statement is misleading as it is, because it's limited to output by print and doesn't effect internal representation.

I don't quite follow that. The only problem is the print function (or perl's interpolation of NV's or whatever we should call it).
There's no issue with perl's internal representation of doubles, since 5.30.0.

Cheers,
Rob
  • Comment on Re^6: [OT: JavaScript] JS remainder operation ('%')

Replies are listed 'Best First'.
Re^7: [OT: JavaScript] JS remainder operation ('%')
by LanX (Saint) on Jan 18, 2024 at 15:04 UTC
    > Some might even argue that "perl's interpolation

    That's a very good point!

    But it's not the interpolation, but more generally the stringification .

    use v5.12; use warnings; $a= 1-1e-16; printf "%.16f\n",$a; printf "%.16f\n",("".$a);

    0.9999999999999999 1.0000000000000000

    Consequently this should be documented for stringification, and print should reference it.

    Update

    Apart from mentions in perlglossary and overload there is not much on stringification to be found in perldocs :/

    https://perldoc.perl.org/perlglossary#stringification

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11157081]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (1)
As of 2024-05-23 13:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found