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

Re: ocaml float computation on NS3.3 #2361

Closed
vicuna opened this issue Jan 20, 2000 · 5 comments
Closed

Re: ocaml float computation on NS3.3 #2361

vicuna opened this issue Jan 20, 2000 · 5 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jan 20, 2000

Original bug ID: 28
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Hi,

Thank you for your message to the Caml mailing list.

However your message seems to be a bug report; hence I send it to the
relevant mailing list

caml-bugs@inria.fr

Thank again for your interest in Caml.

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/

Hello,
I'm using NeXTSTEP 3.3 and ocaml to run the GenWeb software. Although it
compiles easily enough, there is a problem with the math in ocaml

1 > ocaml
Objective Caml version 2.04

2. *. 3. ;;

  • : float = 1.15348445456e+18

Anyone familiar with the origin of this problem?


Paul Buckley
515 W 59th St. #22K
New York, NY 10019

@vicuna
Copy link
Author

vicuna commented Jan 23, 2000

Comment author: administrator

I subscribed to the general list because I had a question. I posted a question
which was diverted to the bugs list. I then tried to subscribe to the bugs
list so that I would know of the result of my question. Should I instead be
expecting a direct reply?

Ah, OK. You can find the (new) database of bugs at
http://caml.inria.fr/bin/caml-bugs/; you'll find your message there
(number 28). Indeed you're supposed to get a direct reply when (if)
we fix your bug. However, we don't have any NeXT machine left, so
it's unlikely that we'll find the bug without your help.

If you're ready to do some cooperative debugging, you could start by
sending us the complete output of the configure script. You can also
try to compile the byte-code interpreter in debug mode
("make ocamlrund" in byterun/).

And we'll try to make up a clearer notification for messages bounced
from caml-list to caml-bugs.

Thanks for your input,

-- Damien

@vicuna
Copy link
Author

vicuna commented Feb 7, 2000

Comment author: administrator

I'm using NeXTSTEP 3.3 and ocaml to run the GenWeb software. Although it
compiles easily enough, there is a problem with the math in ocaml

1 > ocaml
Objective Caml version 2.04

2. *. 3. ;;

  • : float = 1.15348445456e+18

Anyone familiar with the origin of this problem?

Not having access to a NextStep 3.3 machine, I can only venture a guess.
This could be due to a problem with NextStep include files not being
POSIX conformant. More specifically, I suspect the function atof()
isn't declared in <stdlib.h> (where it should be) nor in <math.h>,
causing the C compiler to assume it returns an int and to insert
a bogus int-to-float conversion.

I suggest you try the following: in byterun/floats.c, line 103, before
the definition of "float_of_string", add the line

extern double atof(char * s);

and recompile the Caml system.

  • Xavier Leroy

@vicuna
Copy link
Author

vicuna commented Feb 7, 2000

Comment author: administrator

Looks like a bug in NextStep's include files.

@vicuna vicuna closed this as completed Feb 7, 2000
@vicuna
Copy link
Author

vicuna commented Feb 9, 2000

Comment author: administrator

Thanks for getting back to me.

Xavier Leroy said:

I'm using NeXTSTEP 3.3 and ocaml to run the GenWeb software. Although it
compiles easily enough, there is a problem with the math in ocaml >>
1 > ocaml
Objective Caml version 2.04

2. *. 3. ;;

  • : float = 1.15348445456e+18

Anyone familiar with the origin of this problem?

Not having access to a NextStep 3.3 machine, I can only venture a guess.
This could be due to a problem with NextStep include files not being
POSIX conformant. More specifically, I suspect the function atof()
isn't declared in <stdlib.h> (where it should be) nor in <math.h>,
causing the C compiler to assume it returns an int and to insert
a bogus int-to-float conversion.

atof() is defined in stdlib.h but not the way ocaml expects it:
"
#ifdef STDC
extern double atof(const char *nptr);
#define atof(nptr) strtod(nptr, (char **)NULL)
"

I suggest you try the following: in byterun/floats.c, line 103, before
the definition of "float_of_string", add the line

extern double atof(char * s);

and recompile the Caml system.

It seems to have fixed the ocaml:
"
1 > ocaml
Objective Caml version 2.04

2.*.3.;;

  • : float = 6

"

Thanks.


Paul Buckley
515 W 59th St. #22K
New York, NY 10019

@vicuna
Copy link
Author

vicuna commented Feb 9, 2000

Comment author: administrator

After recompiling with the functioning ocaml installed, GeneWeb calculates
consanguinitiy correctly. Thanks again.



Paul Buckley
515 W 59th St. #22K
New York, NY 10019

@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant