[m-rev.] for review: conversion of 8- and 16-bit integers to floats

Julien Fischer jfischer at opturion.com
Tue Oct 9 15:48:31 AEDT 2018


On Tue, 9 Oct 2018, Peter Wang wrote:

> On Mon, 8 Oct 2018 02:44:06 +0000 (UTC), Julien Fischer <jfischer at opturion.com> wrote:
>> diff --git a/library/float.m b/library/float.m
>> index d9b3c68..ad4a3bc 100644
>> --- a/library/float.m
>> +++ b/library/float.m
> ...
>> +    % Convert a signed 8-bit integer into a float.
>> +    % Always succeeds as all signed 8-bit integers have an exact
>> +    % floating-point representation.
>> +    %
>> +:- func from_int8(int8) = float.
>> +
>> +    % Convert an unsigned 8-bit integer into a float.
>> +    % Always succeeds as all unsigned 8-bit integers have an exact
>> +    % floating-point representation.
>> +    %
>> +:- func from_int16(int16) = float.
>
> signed 16-bit

Fixed.

>> +
>> +    % Convert a signed 16-bit integer into a float.
>> +    % Always succeeds as all signed 16-bit integers have an exact
>> +    % floating-point representation.
>> +    %
>> +:- func from_uint8(uint8) =  float.
>
> unsigned 8-bit

Fixed.

...

> That's fine otherwise.

Thanks for that!

Julien.


More information about the reviews mailing list