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

Ticket #119 (closed task: fixed)

Opened 2 years ago

Last modified 2 years ago

text.convert.Format needs to support 80-bit reals

Reported by: Don Clugston Assigned to: kris
Priority: normal Milestone: 0.97 RC 1
Component: Tango Version:
Keywords: Cc:

Description

Currently reals just get cast to double in output.

Change History

10/27/06 16:28:30 changed by larsivi

  • milestone set to 0.8.

11/01/06 22:03:41 changed by kris

  • status changed from new to assigned.

Yeah. I'm hoping for some guidance on this from yourself, Don? There's the 'performance' questionmark, and the portability thing too? Additionally, and perhaps more importantly, the algorithms used for both parsing and formatting FP numbers could use some critical review.

11/23/06 11:06:37 changed by Don Clugston

Yes, I'm just not yet familiar enough with the way Mango I/O works. I'm a little confused by the code duplication in Double.d and Format.d, in my initial investigation I couldn't work out the relationship between the two. Once I get the meta.Nameof stuff under control, I'll get onto this.

11/25/06 03:35:26 changed by larsivi

  • milestone changed from 0.8 to 0.95 Beta1.

11/25/06 06:14:36 changed by Don Clugston

  • owner changed from kris to Don Clugston.
  • status changed from assigned to new.

11/25/06 06:16:59 changed by Don Clugston

  • status changed from new to assigned.

I'll take over this one.

(follow-up: ↓ 8 ) 12/17/06 14:57:53 changed by Don Clugston

  • owner deleted.
  • status changed from assigned to new.

Oops, I certainly can't do this, especially since my previous changes were removed. This formatting of FP numbers is a real mess at the moment.

(in reply to: ↑ 7 ) 12/17/06 17:52:11 changed by kris

Yeah, I agree.

DGDouble will go, and the stuff in Formatter will get folded (somehow) with the code in Double. I suspect we need to update the code in Double to be the de-facto converter for Tango, and perhaps base it on real rather than double. This will probably require a review of how effective the code in Formatter is -- a different algorithm altogether.

I don't have the skills to do a critical review (though I can write the stuff), so this is where I'd hoped you could help out ...

(follow-up: ↓ 10 ) 12/18/06 04:26:08 changed by Don Clugston

That makes sense to me. I still don't have a very good understanding of Mango IO. Might be better to call the module Float instead of Double (?) The minimal approach would be to just link to the C library's long double ecvt and fcvt, to get the functionality in place, and then look at replacing it with D code. (Interesting quirky fact: the reason why 80-bit reals originally existed was so that a naive implementation of fp <-> decimal conversion would be correct for most normal 'double' values).

Localisation of FP is an interesting issue. I don't think it should involve anything more than the decimal point indicator. I propose: * Follow IEEE 754r and display infinity as +Inf, -Inf, regardless of language, and display NaN as NaN (regardless of sign). * Seperating numbers into comma-seperated groups is generally undesirable in scientific contexts.

I won't have much D time available before 1.0, so probably won't be able to contribute much, but should be able to do some review.

(in reply to: ↑ 9 ) 12/18/06 06:21:20 changed by kris

thanks!

02/03/07 10:07:23 changed by larsivi

  • milestone changed from 0.95 Beta1 to 0.96 Beta 2.

03/04/07 14:31:15 changed by kris

  • owner set to kris.
  • priority changed from major to normal.
  • status changed from new to assigned.
  • milestone changed from 0.96 Beta 2 to 0.97 RC 1.

80bit is implemented, but I'm still not sure the best way to do hex support. Looking into %A

04/03/07 23:18:55 changed by kris

  • status changed from assigned to closed.
  • resolution set to fixed.
  • summary changed from text.convert.Format needs to support 80-bit reals and '%A' format hex output to text.convert.Format needs to support 80-bit reals.

Splitting this ticket into 2. The 80bit stuff was done for last release