Dear everyone Happy new year Can somebody tell me how I can represent positive infinity float number in Ocaml? Is there such symbol in Ocaml library? Best...
Zhifeng Sheng
z.sheng@...
Jan 6, 2006 2:31 pm
5242
Dear everyone Happy new year Can somebody tell me how I can represent infinity float number? Is there such notation in the Ocaml library? Best regards Zhifeng...
Zhifeng Sheng
z.sheng@...
Jan 6, 2006 2:42 pm
5243
... $ ocaml Objective Caml version 3.08.4 # infinity;; - : float = infinity -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists ...
... And it's neg_infinity for negative infinity. It's all in the manual, in the floating-point arithmetic part of the section on the Pervasives module...
Hi, This function was supposed to be an implementation of simpson's rule for integration, but the Ocaml interpreter won't accept it; can anyone find anything...
Well... I got: "Unbound value gosimp" So, you better define the functions you want to use.. the first problem seems to be: you call a function inside itself: ...
Oliver Bandel
oliver@...
Jan 7, 2006 1:19 am
5248
... All of which are correct- there are several places where it looks like he's using + and - (integer addition and subtraction) when he needs to be using +....
I'd also point out the mod operator, for integer modulo, as an answer to his second question. Brian Can you give example as to how to use the mod operator? I...
... No. ... These ARE type errors. An "int" is not a "float", it's a different type. ... Second question? Didn't remembre there was one. ;-( Ciao, Oliver...
Oliver Bandel
oliver@...
Jan 7, 2006 1:58 pm
5252
Hey, Thanks for answering my last question, I finally got the 1-D simpson's method working, but when I extended it to 2-D with the following code, I got a...
... What's the code for go2simp? Or more importantly, what is its type signature? Let's see: You declare let rec go2simp sum x i n f, but also have match (i...
... Isn't the hint given by the compiler quite accurate? It says you pass a float value to some parameter which is supposed to be a int. - According to...
Wish it helps. code17 It helps alot, thanks! -Jerry ... Yahoo! Photos – Showcase holiday pictures in hardcover Photo Books. You design it and we’ll bind...
Hello, list Not sure whether the following problem belongs to OCaml or general UNIX issues: Suppose I have two file_descr already exist, in_fd for reading,...
I'm addressing this from the Unix side of things. ... Well, BSD has sendfile, which copies data from a regular file to a socket. That has some possibilities,...
... Thanks for the hint. ... If I understand correctly, you are actually suggesting I open the two worlds with specific file_descr instead of their stdin...
Hi, I'm trying to figure out how I can declare two classes where each needs to know the others type. This is a rough illustration, but I want to do something...
... The only thing I know of that will do what you want is the sendfile call - and it may not work. I don't know how portable it is, so you'll have to check...
... Hi, you need to cast self in the initializer (and more generally whenever you use it as an argument to a function/method outside the class) because self's...
Hello all, my problem can be summed up in one line : #10.87+.0.01;; - : float = 10.879999999999999 Of course I can redefine my own float type and operations, ...
... #include <stdio.h> void main (){ float a , b; a = 10.87; b = 0.01; printf ("%.10f\n", a + b); } ... The output of this program is : 10.8799998853 Rounding...
... The standard floats, used by almost all computer languages & implementations including OCaml and C, use a binary representation such that neither 10.87 nor...
... Short answer: No. Long answer: here's the problem. Floating point is of finite precision. For any base, *any* base, there are simple fractions which can...