poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] pkl,std: add `stof' and `stod'


From: Jose E. Marchesi
Subject: Re: [PATCH] pkl,std: add `stof' and `stod'
Date: Thu, 16 Mar 2023 09:20:45 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Hi Mohammad.

I like the patch.

> +float pvm_stof (const char *str)
> +{
> +  return (float) atof (str);
> +}
> +
> +double pvm_stod (const char *str)
> +{
> +  return atof (str);
> +}

atof doesn't detect errors.  What about using strtod instead?  Then the
instructions can push PVM_NULL on the stack in case of an error, and the
stof/stod utility functions can raise exceptions accordingly.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]