develooper Front page | perl.perl5.porters | Postings from July 2014

[perl #122219] support hexadecimal floats

Thread Previous | Thread Next
Jarkko Hietaniemi
July 3, 2014 02:50
[perl #122219] support hexadecimal floats
Message ID:
# New Ticket Created by  Jarkko Hietaniemi 
# Please include the string:  [perl #122219]
# in the subject line of all future correspondence about this issue. 
# <URL: >

[resubmitting since I think the grues ate my first attempt]

Perl could support hexadecimal floats:

* literals: 0xh.hhhp[+-]?NNN, e.g. 0x1.47ae147ae147bp-7 is 0.1
* printf %a %A
* input (PV->NV): "0xh.hhhpnnn" + 3

Lack of %a noted by Dan Kogai:
Pointer given by Dan:

Possibly useful resource: found by quick googling.

Ruby does support the %a %A as noted by Dan, and Python has float.hex() and float.fromhex().

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About