Today we were programming something in university which dealt with really large numbers (even larger than unsigned long) and we had to create a code that broke the numbers into an array and performed operations on them.

I know that an Arduino is an 8 bit MCU, but I was wondering if similar approaches could be used to do 32 bit double precision floating point operations (or even better, i.e quad precision, etc) using the Arduino (e.g. create a quad precision calculator or similar applications).

I know it sounds silly or similar to a brute force method, but I'm really curious if it's possible to do such things.

  • 2
    Anything is possible if you have the programming skills. Natively the highest precision Arduino supports is float. Anything more precise you will have to code your own support for from scratch. Or there's Nick Gammon's Big Number library for massive integer use. – Majenko Jan 8 at 11:27
  • 1
    Note also that double precision is actually 64 bits (with 52+1 bits in the mantissa). For integers, avr-gcc natively supports int64_t and uint64_t. – Edgar Bonet Jan 8 at 11:43
  • The source code for float handling in AVR could be a starting point. The compiler back-end for AVR might need changing so that true double literal numbers could be used in sketches. github.com/vancegroup-mirrors/avr-libc/tree/master/avr-libc/… – Mikael Patel Jan 8 at 14:24
  • Thanks everyone. I'm a bit busy but I'll try to come up with some sort of code myself. I'll ask more details if I couldn't figure something on my own, thanks. – OM222O Jan 9 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.