Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
sqrt function
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//gcc 4.9.3 #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } float syn(float *a, float *b, int dimensions) { float similarity=0; float sumup=0; float sumdown=0; float as=0; float bs=0; int i; for(i=0; i<dimensions; i++) { sumup = sumup + a[i] * b[i]; as = as + a[i] * a[i]; bs = bs + b[i] * b[i]; } sumdown = sqrtf(as) * sqrtf(bs); similarity = sumup / sumdown; return similarity; }
gcc
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 0.12 sec, absolute running time: 0.13 sec, cpu time: 0 sec, memory peak: 3 Mb, absolute service time: 0,34 sec
edit mode
|
history
|
discussion
Hello, world!
stackse - search stackoverflow differently