I'm making a calculator operating system for a proof of concept Rust OS. I've dug myself into a sort of deep hole with how I handle math, but I don't want to have to rework it all. I have 2 numbers (they are technically f64s but will never have a floating point) and I need to add them Javascript style (1 + "1" = 11). This is all in a #![no_std] environment so I can't use something like format!() or even owned Strings as I have no allocator.
Rust isn't JS so I can't 1 + "1" and obviously + is a binary operation.
Edit: I ended up using the arrayvec library as suggested in How to format output to a byte array with no_std and no allocator?
Convert the numbers to integers, then count the number of times you need to divide
bby 10 until you reach 0 and multiplyaby 10 this same number of times:Playground