| Anonymous | Login | Signup for a new account | 2013-05-22 16:24 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
| 0005739 | OCaml | OCaml standard library | public | 2012-08-25 15:48 | 2012-09-27 14:53 | ||||||
| Reporter | smimram | ||||||||||
| Assigned To | |||||||||||
| Priority | normal | Severity | minor | Reproducibility | always | ||||||
| Status | confirmed | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | 3.12.1 | ||||||||||
| Target Version | 4.00.2+dev | Fixed in Version | |||||||||
| Summary | 0005739: Printf.printf "%F" (-.nan) returns -nan | ||||||||||
| Description | When trying to generate code for OCaml (in OCaml) I expected Printf.printf "%F" to generate a float which is a valid expression in OCaml syntax: according to the documentation "%F converts a floating-point argument to Caml syntax". However, # -nan;; Error: This expression has type float but an expression was expected of type int # Printf.printf "%F\n" (-.nan);; -nan - : unit = () Maybe should the last expression return "-.nan" (or the syntax could be modified to allow -nan). | ||||||||||
| Steps To Reproduce | Printf.printf "%F\n" (-.nan);; | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Relationships |
||||||
|
||||||
Notes |
|
|
(0007985) gasche (developer) 2012-08-25 18:53 edited on: 2012-08-25 19:04 |
Confirmed under 3.12.1 and 4.00. printf "%F" neg_infinity also prints "-inf" which suffers from the same problem. I think this was already discussed in 0004688. If I understand correctly the patch of "dra" in 0004688, the effect of (printf "%F" (-.nan)) on the Windows platform (mingw or MSVC) could be to return "nan" instead of the negative nan on 4.00 -- I can't test myself, though. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-08-25 15:48 | smimram | New Issue | |
| 2012-08-25 18:50 | gasche | Relationship added | related to 0004688 |
| 2012-08-25 18:53 | gasche | Note Added: 0007985 | |
| 2012-08-25 18:53 | gasche | Status | new => confirmed |
| 2012-08-25 19:04 | gasche | Note Edited: 0007985 | View Revisions |
| 2012-09-06 16:43 | doligez | Target Version | => 4.00.1+dev |
| 2012-09-27 14:53 | doligez | Target Version | 4.00.1+dev => 4.00.2+dev |
| Copyright © 2000 - 2011 MantisBT Group |