<commit_before>class CreateScene{
    constructor(){ 
        this.scene = new THREE.Object3D();
    }
    getObject(){
        return this.scene;
    }
    addVoxel(voxels,direction){
        // Add voxels to object
        var di = Math.sqrt(voxels.length/4);
        var aPlane = new THREE.Object3D();
        var geometry = new THREE.BoxGeometry( 2/di, 2/di, 2/di );
        for(var index=0; index<voxels.length; index+=4){
            if(voxels[index+1] != 0){
                var color = Math.floor(Math.random()*16777215);
                var material = new THREE.MeshBasicMaterial( {color: color} );
                var voxel = new THREE.Mesh( geometry, material );
                var corX = (index / 4) % di;
                var corY = Math.floor((index / (4 * di)));
                console.log(corX + " " + corY);
                voxel.position.x = corX*2/di-1 + (1/di);
                voxel.position.y = corY*2/di-1 + (1/di);
                voxel.position.z = Math.floor(voxels[index])/(di/2) + 1/di;
                console.log(voxels[index]);
                console.log(voxel.position.z);
                aPlane.add(voxel);
            }
        }
        //rotate object
        if(direction < 4){
            aPlane.rotation.y = (Math.PI/2) * direction;
        }else if(direction == 4){
            aPlane.rotation.x = -Math.PI/2;
        }else{
            aPlane.rotation.x = Math.PI/2;
        }
        //add object
        this.scene.add(aPlane);
    }
}<commit_msg>fix floating-point error<commit_after>class CreateScene{
    constructor(){ 
        this.scene = new THREE.Object3D();
    }
    getObject(){
        return this.scene;
    }
    addVoxel(voxels,direction){
        // Add voxels to object
        var di = Math.sqrt(voxels.length/4);
        var aPlane = new THREE.Object3D();
        var geometry = new THREE.BoxGeometry( 2/di, 2/di, 2/di );
        for(var index=0; index<voxels.length; index+=4){
            if(voxels[index+1] != 0){
                var color = Math.floor(Math.random()*16777215);
                var material = new THREE.MeshBasicMaterial( {color: color} );
                var voxel = new THREE.Mesh( geometry, material );
                var corX = (index / 4) % di;
                var corY = Math.floor((index / (4 * di)));
                console.log(corX + " " + corY);
                voxel.position.x = (corX*2/di-1 + (1/di));
                voxel.position.y = -(corY*2/di-1 + (1/di));
                voxel.position.z = -(Math.round(voxels[index] -1)/(di/2) + 1/di);
                console.log(voxels[index]);
                console.log(voxel.position.z);
                aPlane.add(voxel);
            }
        }
        //rotate object
        if(direction < 4){
            aPlane.rotation.y = (Math.PI/2) * direction;
        }else if(direction == 4){
            aPlane.rotation.x = -Math.PI/2;
        }else{
            aPlane.rotation.x = Math.PI/2;
        }
        //add object
        this.scene.add(aPlane);
    }
}
{'fraction_non_alphanumeric': 0.14637391882900866, 'fraction_numerical': 0.022288755821689953, 'mean_word_length': 1.5311447811447811, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6115270', 'n_tokens_mistral': 1045, 'n_tokens_neox': 974, 'n_words': 185}