| Anonymous | Login | Signup for a new account | 2013-06-19 05:05 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 | |||||||
| 0001867 | OCaml | OCaml general | public | 2003-10-06 00:50 | 2012-01-27 12:15 | |||||||
| Reporter | administrator | |||||||||||
| Assigned To | ||||||||||||
| Priority | normal | Severity | feature | Reproducibility | always | |||||||
| Status | resolved | Resolution | fixed | |||||||||
| Platform | OS | OS Version | ||||||||||
| Product Version | ||||||||||||
| Target Version | Fixed in Version | 3.11.0 | ||||||||||
| Summary | 0001867: Feature wish: representation des nats | |||||||||||
| Description | Bonjour, Serait-il possible d'ajouter des fonctions dans les modules Nats et Big_int pour acceder à la representation des entiers sous forme de strings? Vu le code de serialize_nat, c'est trivial. Je ne peux pas utiliser le système de marshaling de Caml sur mes structures de données, donc j'ai du refaire tout le parcours et le marshalling à la main. Pour traiter les Big_int.big_int, je vois deux solutions actuellement: Marshal.to_string ou Big_int.string_of_big_int. Le premier introduit un gros en-tete (36 octets pour representer l'entier 0), le deuxième fait des calculs inutiles et utilise moins de 4 bits par octets. (Au passage, des précisions sur les restrictions d'utilisation de la bibliothèque Num mentionnées dans la mailing list m'interessent également). Alain | |||||||||||
| Tags | No tags attached. | |||||||||||
| Attached Files | ||||||||||||
Notes |
|
|
(0006823) xleroy (administrator) 2012-01-27 12:15 |
The nth_digit_nat_native and set_digit_nat_native of module Nat, introduced in 3.11.0, make it possible to implement the desired feature with good efficiency. My recommendation, however, is to use the ZArith library instead of the Num standard library: ZArith provides conversions to/from bit strings, and is globally superior to Num. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2005-11-18 10:13 | administrator | New Issue | |
| 2012-01-27 12:15 | xleroy | Note Added: 0006823 | |
| 2012-01-27 12:15 | xleroy | Status | acknowledged => resolved |
| 2012-01-27 12:15 | xleroy | Resolution | open => fixed |
| 2012-01-27 12:15 | xleroy | Fixed in Version | => 3.11.0 |
| 2012-01-27 12:15 | xleroy | Description Updated | View Revisions |
| Copyright © 2000 - 2011 MantisBT Group |