Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How would you describe math in comments?

Well as the questions says...

An equation might be more meaningful in its math-notated form than it is in code. Being able to put math in comments could improve readabibity on my projects.

In .NET btw.

like image 756
Bertvan Avatar asked May 04 '09 08:05

Bertvan


People also ask

How would you describe math?

Mathematics is the science and study of quality, structure, space, and change. Mathematicians seek out patterns, formulate new conjectures, and establish truth by rigorous deduction from appropriately chosen axioms and definitions.

How do we express mathematics?

We write an expression in math by using numbers or variables and mathematical operators which are addition, subtraction, multiplication, and division. For example, the expression of the mathematical statement "4 added to 2", will be 2+4.

What is good about math?

Math helps strengthen reasoning skills and critical thinking. It helps us think analytically about the world and reason logically. The same steps you take to understand a problem, identify the knows and unknows and then solve it, can be applied to other areas of your life.


1 Answers

I just use multiple lines to do it thus:

// Work out average as:  sum (values)
//                      --------------
//                      count (values)
//
// and distance between points as:
//           _______________________
//          /         2            2
//    d = \/ (x1 - x0)  + (y1 - y0)
//
// and the following function:
//
//             3     2   
//    f(x) = ax  + bx  + cx + d

No magic required for that at all. Don't you just love ASCII art?

like image 63
paxdiablo Avatar answered Oct 21 '22 05:10

paxdiablo