~torresjrjr/dc

ae7c43183148c8699e9357076c5d02ef6db4ef2b — Byron Torres 6 months ago 604739e
add ^ exponentiation cmd
1 files changed, 8 insertions(+), 0 deletions(-)

M dc.ha
M dc.ha => dc.ha +8 -0
@@ 150,6 150,14 @@ export fn main() void = {
			const b = pop();
			const a = pop();
			push(math::modf64(a, b));
		case '^' =>
			if (len(S) < 2) {
				fmt::errorln("dc: stack has too few elements")?;
				continue;
			};
			const b = pop();
			const a = pop();
			push(math::powf64(a, b));
		case =>
			fmt::errorfln("dc: unimplemented '{}'", r)?;
		};