Hello all,
I'm getting results which I am not understanding using the same division with fixed values vs global variables - which are float variables.

Below - I have function1 and function2
Theoretically - these should return the same division results
The first function does not use global variables
The second function does

// Global Variables
float number = 99999999;
float divisor = 10000000;
void function1() {
float result = 99999999/10000000;
byte currentnum = (int)result;
Serial.println(currentnum);
}

With the function above - the value for "result" is 9.9999999
This is what it should be
The correct integer derived from that is 9 which is correct

// Global Variables
float number = 99999999;
float divisor = 10000000;
void function2(){
float result = number/divisor;
byte currentnum = (int)result;
Serial.println(currentnum);
}

This function is different in that it is drawing off global variables declared at the onset of the code.

But the values are exactly the same.

In this case it calculates "result" with the value of 10.00
Which is incorrect.

Actually, no, for several reasons. The function has the following line, but the right hand side is an integer divide, the result of which is 9. However, the compiler has several options for how to deal with the result. Compiler optimization will ignore the divide and simply store some value in "result" (*);

float result = 99999999/10000000;

Second, float variables are 32 bits and have only 6-7 digits of precision total. 9.9999999 cannot be exactly represented by a float value.

(*) Just tested, and on the Arduino Uno R3, the stored result is 9.0, as expected. The following code prints 100000000.00000000 for the same reason, because 99999999 cannot be stored exactly in a float, so it is rounded up.

I was playing with an 8-digit seven-segment display - seeing what numbers I could get it to display up to its maximum displayable value.

I changed my approach and made the process much simpler
It occurred to me to simply take whatever number it would display with 8 digits and and convert that number to a string.

Then its a simple matter of iterating through each numeric character in that string and sending them in their order to the display.

You have the intention of assigning a floating point number (integer part + fractional part) to the number variable. If so, why are typing 99999999 instead of 99999999.0? If you want to type really 99999999, then you should make the following declaration:

unsigned long number = 99999999;

To show the number on an 8-digit 7-segment display unit, you may use the modulas(%) and division(/) operators to extract the digits from the given "int type number" and then consult the digit-vs-cc table to get the cc-codes.