Here you can find the source of seconds2timecents(double seconds)
Parameter | Description |
---|---|
seconds | the time in seconds |
public static final int seconds2timecents(double seconds)
//package com.java2s; public class Main { /**/*from w w w. j a v a 2 s . co m*/ * @param seconds the time in seconds * @return the converted timecents [-32768...+32767] */ public static final int seconds2timecents(double seconds) { if (seconds <= 0) { return -32768; } else if (seconds >= 165910888) { return 32767; } // TODO: use a table return (int) (1200.0 * Math.log(seconds) / Math.log(2)); } }