Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undocumented exception(s) in the Num module #13

Open
vicuna opened this issue Nov 28, 2015 · 4 comments
Open

Undocumented exception(s) in the Num module #13

vicuna opened this issue Nov 28, 2015 · 4 comments

Comments

@vicuna
Copy link

vicuna commented Nov 28, 2015

Original bug ID: 7065
Reporter: SpiceGuid
Status: acknowledged (set by @gasche on 2015-11-28T20:19:38Z)
Resolution: open
Priority: low
Severity: feature
Target version: later
Category: documentation

Bug description

Some people assume they can compute square root or cubic root by providing
a 1/2 or 1/3 ratio argument to the Num.power_num function.

Unfortunately they can't :

# #load "nums.cma";;
# open Num;;
# int_of_num (Int 27 **/ (Int 1 // Int 3));;
Exception: Invalid_argument "power_num".

The problem is not they can't, the problem is they assume they can and are encouraged by the silent documentation to do so.

I suggest that all Num functions should be totally documented, including exceptions and conditions that can raise them.

@vicuna
Copy link
Author

vicuna commented Nov 28, 2015

Comment author: @gasche

Patches to propose documentation would be warmly welcome :-)

@nojb
Copy link
Contributor

nojb commented Mar 16, 2019

I guess this should be moved to ocaml/num @xavierleroy

@xavierleroy
Copy link
Contributor

You're right. I derive great pleasure from moving old issues around!

@xavierleroy xavierleroy transferred this issue from ocaml/ocaml Mar 16, 2019
@xavierleroy
Copy link
Contributor

As mentioned earlier, pull requests that propose improvements to the documentation would be warmly welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants