Add support for the float_integer_part/1 and float_fractional_part/1 standard arithmetic functions

This commit is contained in:
Paulo Moura
2021-09-27 12:27:09 +01:00
parent ca62e54652
commit 495025dafb
4 changed files with 20 additions and 0 deletions

View File

@@ -1175,6 +1175,18 @@ impl MachineState {
self.interms[t - 1] = self.floor(n1);
self.p += 1;
}
&ArithmeticInstruction::FloatIntegerPart(ref a1, t) => {
let n1 = try_or_fail!(self, self.get_number(a1));
self.interms[t - 1] = self.trunc(n1);
self.p += 1;
}
&ArithmeticInstruction::FloatFractionalPart(ref a1, t) => {
let n1 = try_or_fail!(self, self.get_number(a1));
self.interms[t - 1] = self.fract(n1);
self.p += 1;
}
&ArithmeticInstruction::Plus(ref a1, t) => {
let n1 = try_or_fail!(self, self.get_number(a1));