Showing posts with label Math. Show all posts
Showing posts with label Math. Show all posts

Mar 12, 2016

Javascript pow() function

In Javascript if you want to rise a number to a power then you have to use one of the functions from Math module: Math.pow()

The Math.pow() function returns the base to the exponent power, that is, base exponent.

Syntax

Math.pow(base, exponent)

Parameters

base
The base number.
exponent
The exponent used to raise the base.

Description

Because pow() is a static method of Math, you always use it as Math.pow(), rather than as a method of aMath object you created (Math has no constructor).
Examples:
Math.pow(4,3);   // 4 * 4 * 4 = 48

Aug 14, 2015

CakePHP

Last 2 weeks I tried to put ZF2 to my project www.mateonline.net. It was endless pain to configure Zend Framework 2 for me as a beginner with this. ZF2 as syntax is very nice. But something got wrong with server configuration.
So, then I said I will try Symfony 2. But, I quit immediately. I though it will be easier, but it is no so nice as ZF2.
And, then I pass to CakePHP. Which I like. Except the fact that it has no PDO. I don't like  how is linked to MySQL DB but I can use to it.

Feb 25, 2014

Math library in Java ME

Math.round() is not available in J2ME.
So, it's hard to round a double.