Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #337 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

Sprint and friends format NAN floats as 0.00

Reported by: yeti Assigned to: kris
Priority: major Milestone: 0.97 RC 1
Component: Core Functionality Version: trunk
Keywords: Cc:

Description

bad ;)

Change History

03/17/07 11:34:46 changed by sean

  • owner changed from sean to kris.

I'm handing this off to Kris, as Sprint is his territory. I think we need support for the following: +INF, -INF, NAN, +0.0, -0.0.

For what it's worth, C99 allows the following for infinity: inf, INF, infinity, INFINITY. And the following for NaN: nan, NAN.

We should probably also support both fixed and scientific notation for floating point numbers, and hex representation for floating point and integer numbers. I'm not sure how many of these are already supported, but I wanted to write this down while I was thinking about it. My old unformat code for Phobos did all this on the read-side, so it may be marginally useful as a reference for what forms of representation we might want to include (assuming the C# format spec doesn't define its own version of all this).

03/17/07 15:23:49 changed by kris

  • status changed from new to closed.
  • version set to trunk.
  • resolution set to fixed.
  • milestone set to 0.97 RC 1.

Float.d has always had support for these, but changed recently to try and be "type agnostic" e.g. no type-specific bit-pattern testing. The infinity test worked but the NaN test failed miserably. Should be OK now

03/17/07 15:42:23 changed by kris

Oh, and thanks for reporting this