Serafim

Untitled

Aug 14th, 2013
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 0.46 KB | None | 0 0
  1. @function pi(){
  2.   @return 3.14;
  3. }
  4.  
  5. // возведение в степень
  6. @function pow($val, $num){
  7.    $result: $num;
  8.    @for $i from 1 through $num{
  9.      $result: $result * $num;
  10.    }
  11.    @return $result;
  12. }
  13.  
  14.  
  15. @function sin($deg){
  16.   $c: 9; // точность тейлора (кратно 2+1)
  17.   $result: $deg;
  18.  
  19.   @for$i from 3 through $c{
  20.     $result: $result + pow($deg, $i) / факториал($i);
  21.     $i: $i+1;
  22.   }
  23.   @return $result;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment