Work on the equality of numbers. The good news: two additional unit tests pass.
The bad news: I'm getting segfaults.
This commit is contained in:
parent
219f082885
commit
b97401bfde
2 changed files with 202 additions and 23 deletions
|
|
@ -521,21 +521,3 @@ bool equal_integer_integer( struct cons_pointer a, struct cons_pointer b ) {
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* true if `a` is an integer, and `b` is a real number whose value is the
|
||||
* value of that integer.
|
||||
*/
|
||||
bool equal_integer_real( struct cons_pointer a, struct cons_pointer b ) {
|
||||
bool result = false;
|
||||
|
||||
if ( integerp( a ) && realp( b ) ) {
|
||||
long double bv = pointer2cell( b ).payload.real.value;
|
||||
|
||||
if ( floor( bv ) == bv ) {
|
||||
result = pointer2cell( a ).payload.integer.value == ( int64_t ) bv;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue