General > The Laboratory

Coding comparison using the Po-Shen Loh's new quadratic formula

**hutch--**:

Hector,

There is a notation that I don't understand.

"Y = a + b*X + c*X^2" What is the "^" operator doing ?

It is a quirk leftover from when I went to primary school (early 1950s) where my arithmetic notation was different to what is being used today.

**zedd151**:

c*X ^ 2

To the power of 2

More simple squared.

E=mc^2 is equal to E=mc2

Used when you can't write superscript

**NoCforMe**:

I'm surprised Steve didn't get that; I've always seen ^ used for exponentiation. Is there a Euro symbol for this that's different?

**hutch--**:

Thanks Z, a "power of ...." makes sense. Its an era thing, having learnt arithmetic in the early 1950s, much modern notation does not fit where what I learnt long ago translates to assembler notation logic far easier. When I did logic at uni, I picked up the discipline of fully bracketing formula and stacked order of precedence does not fit that discipline.

**HSE**:

Hi Hutch!

--- Quote from: hutch-- on September 05, 2022, 05:29:49 AM ---"Y = a + b*X + c*X^2" What is the "^" operator doing ?

--- End quote ---

It's more usual notation for power. If I remember well is used in BASIC from the begining. At least GW-Basic used this notation.

Some old language use "**" for power. Both are programming notations.

In school, or writing, everybody use a superscript: Y = a + b*X + c*X2

--- Quote from: hutch-- on September 05, 2022, 05:47:41 AM --- stacked order of precedence does not fit that discipline.

--- End quote ---

:biggrin: No shunting-yard

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version