¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.

usando la clase Math

Ir abajo

usando la clase Math Empty usando la clase Math

Mensaje  [G]host Mar Dic 07, 2010 8:46 am


public class PruebaMath
{
public static void main( String args[] )
{
System.out.printf( "Math.abs( 23.7 ) = %f\n", Math.abs( 23.7 ) );
System.out.printf( "Math.abs( 0.0 ) = %f\n", Math.abs( 0.0 ) );
System.out.printf( "Math.abs( -23.7 ) = %f\n", Math.abs( -23.7 ) );
System.out.printf( "Math.ceil( 9.2 ) = %f\n", Math.ceil( 9.2 ) );
System.out.printf( "Math.ceil( -9.8 ) = %f\n", Math.ceil( -9.8 ) );
System.out.printf( "Math.cos( 0.0 ) = %f\n", Math.cos( 0.0 ) );
System.out.printf( "Math.exp( 1.0 ) = %f\n", Math.exp( 1.0 ) );
System.out.printf( "Math.exp( 2.0 ) = %f\n", Math.exp( 2.0 ) );
System.out.printf( "Math.floor( 9.2 ) = %f\n", Math.floor( 9.2 ) );
System.out.printf( "Math.floor( -9.8 ) = %f\n",
Math.floor( -9.8 ) );
System.out.printf( "Math.log( Math.E ) = %f\n",
Math.log( Math.E ) );
System.out.printf( "Math.log( Math.E * Math.E ) = %f\n",
Math.log( Math.E * Math.E ) );
System.out.printf( "Math.max( 2.3, 12.7 ) = %f\n",
Math.max( 2.3, 12.7 ) );
System.out.printf( "Math.max( -2.3, -12.7 ) = %f\n",
Math.max( -2.3, -12.7 ) );
System.out.printf( "Math.min( 2.3, 12.7 ) = %f\n",
Math.min( 2.3, 12.7 ) );
System.out.printf( "Math.min( -2.3, -12.7 ) = %f\n",
Math.min( -2.3, -12.7 ) );
System.out.printf( "Math.pow( 2.0, 7.0 ) = %f\n",
Math.pow( 2.0, 7.0 ) );
System.out.printf( "Math.pow( 9.0, 0.5 ) = %f\n",
Math.pow( 9.0, 0.5 ) );
System.out.printf( "Math.sin( 0.0 ) = %f\n", Math.sin( 0.0 ) );
System.out.printf( "Math.sqrt( 900.0 ) = %f\n",
Math.sqrt( 900.0 ) );
System.out.printf( "Math.sqrt( 9.0 ) = %f\n", Math.sqrt( 9.0 ) );
System.out.printf( "Math.tan( 0.0 ) = %f\n", Math.tan( 0.0 ) );
} // fin de main
} // fin de la clase PruebaMath

[G]host
[G]host
Admin

Mensajes : 67
Puntos : 204
Reputación : 0
Fecha de inscripción : 24/10/2010
Edad : 33

https://ghost.activo.mx

Volver arriba Ir abajo

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.