This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''Programma per integrare e^x da 0 a 1''' | |
import numpy as np | |
import matplotlib.pyplot as plt | |
def rettangoli_naif(h,f): | |
inte=0.0 | |
for i in range(f.shape[0]-1): | |
inte+=f[i] | |
inte*=h | |
return inte |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hexString = | |
"4a1b48d7322394a78326cd283f0834093e65421a7e98e90e5b452d160b5d07d8"; | |
const expectedEncodedString = "ShtI1zIjlKeDJs0oPwg0CT5lQhp+mOkOW0UtFgtdB9g="; | |
const hexBuffer = Buffer.from(hexString, "hex"); | |
const encodedString = Buffer.from(hexBuffer).toString("base64"); | |
console.log(`Actual output:\t ${encodedString}`); | |
console.log(`Expected output: ${expectedEncodedString}`); |